import turtle as t
point = [0, 0]
dis = 10
index = 1
def draw():
    t.clear()
    t.up()
    t.goto(point)
    t.down()
    t.dot(20, "red")
    move()
    t.ontimer(draw, 300)

def move():
    point[index] += dis
def func_up():
    global  dis, index
    index = 1
    dis = 10
def func_down():
    global dis, index
    index = 1
    dis = -10
def func_left():
    global dis, index
    dis = -5
    index = 0

def func_right():
    global dis, index
    dis = 5
    index = 0


if __name__ == '__main__':
    t.tracer(False)
    draw()
    t.onkeypress(func_down, "Down")
    t.onkeypress(func_up, "Up")
    t.onkeypress(func_left, "Left")
    t.onkeypress(func_right, "Right")
    t.listen()
    t.done()